package javango.db;

public class AbstractModel {

	private Managers managers;
	
	public AbstractModel(Managers managers) {
		this.managers = managers;
	}
	
	public AbstractModel save() throws ManagerException {
		Manager manager = managers.forClass(this.getClass());
		manager.save(this);
		return this;
	}
	
	public void delete() throws ManagerException {
		Manager manager = managers.forClass(this.getClass());
		manager.delete(this);
	}
	
}
